<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box1 {
            width: 100px;
            height: 100px;
            background-color: aqua;
            text-align: center;
        }
    </style>
</head>

<body>
    <!--   1. 鼠标放上去显示 移开消失 -->
    <div id="app">
        <div id="box1" @mouseover="over" @mouseout="out">鼠标</div>
        <p v-if="display">11111111</p>
    </div>
</body>
<script src="/vue.js"></script>
<script>
    const { createApp, ref } = Vue;
    createApp({
        setup() {

            let display = ref(false)
            function over() {
                display.value = !display.value
            }
            function out() {
                display.value = false
            }
            return {
                over,
                out,
                display

            }
        }
    }).mount("#app")
</script>

</html>